import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.jdbc.core.JdbcTemplate;

public class TextJdbcTemplate {
    @Test
    public void testExecute() {
        ApplicationContext context = new ClassPathXmlApplicationContext("spring-config.xml");
        JdbcTemplate jdbc = context.getBean(JdbcTemplate.class);
        String sql = "create table account(" + "id int primary key auto_increment," + "username varchar(50)," + "balance double" + ")";
        jdbc.execute(sql);
        System.out.println("account数据表创建成功！");
    }
}